#endif
}
-#ifdef MULTI_FRAME
/* If this event is on a different frame, return a switch-frame this
time, and leave the event in the queue for next time. */
else
{
+#ifdef MULTI_FRAME
Lisp_Object frame = event->frame_or_window;
Lisp_Object focus;
&& XFRAME (frame) != selected_frame)
obj = make_lispy_switch_frame (frame);
internal_last_event_frame = frame;
+#endif /* MULTI_FRAME */
/* If we didn't decide to make a switch-frame event, go ahead
and build a real event from the queue entry. */
kbd_fetch_ptr = event + 1;
}
}
-#endif
}
else if (do_mouse_tracking && mouse_moved)
{
{
/* X Keysym value */
- 0, 0, 0, 0, 0, 0, 0, 0, /* 0xff00 */
+ "remove", 0, 0, 0, 0, 0, 0, 0, /* 0xff00 */
"backspace",
"tab",
"linefeed",
#ifdef USE_TEXT_PROPERTIES
maps[nmaps-2] = get_local_map (PT, current_buffer);
#else
- maps[nmaps-2] = current_buffer->local_map;
+ maps[nmaps-2] = current_buffer->keymap;
#endif
maps[nmaps-1] = global_map;
}
echo_start = echo_length ();
keys_start = this_command_key_count;
+#if 0 /* This doesn't quite work, because some of the things
+ that read_char does cannot safely be bypassed.
+ It seems too risky to try to make this work right. */
/* Read the first char of the sequence specially, before setting
up any keymaps, in case a filter runs and switches buffers on us. */
first_event = read_char (!prompt, 0, submaps, last_nonmenu_event,
&junk);
+#endif
/* We jump here when the key sequence has been thoroughly changed, and
we need to rescan it starting from the beginning. When we jump here,
#ifdef USE_TEXT_PROPERTIES
submaps[nmaps-2] = get_local_map (PT, current_buffer);
#else
- submaps[nmaps-2] = current_buffer->local_map;
+ submaps[nmaps-2] = current_buffer->keymap;
#endif
submaps[nmaps-1] = global_map;
}
/* If not, we should actually read a character. */
else
{
+ struct buffer *buf = current_buffer;
+
last_real_key_start = t;
- if (! NILP (first_event))
- {
- key = first_event;
- first_event = Qnil;
- }
- else
- key = read_char (!prompt, nmaps, submaps, last_nonmenu_event,
- &used_mouse_menu);
+ key = read_char (!prompt, nmaps, submaps, last_nonmenu_event,
+ &used_mouse_menu);
/* read_char returns -1 at the end of a macro.
Emacs 18 handles this by returning immediately with a
keybuf[t+1] = key;
mock_input = t + 2;
+ /* If we switched buffers while reading the first event,
+ replay in case we switched keymaps too. */
+ if (buf != current_buffer && t == 0)
+ goto replay_sequence;
goto replay_key;
}
}
}
}
}
+
+ /* If we switched buffers while reading the first event,
+ replay in case we switched keymaps too. */
+ if (buf != current_buffer && t == 0)
+ {
+ keybuf[t++] = key;
+ mock_input = t;
+ goto replay_sequence;
+ }
}
/* We have finally decided that KEY is something we might want